<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

    public function _initRoutes() {
        $frontController = Zend_Controller_Front::getInstance();
        $router = $frontController->getRouter();

        $route = new Zend_Controller_Router_Route(
                        ':controller/:action/:id',
                        array('controller' => 'index', 'action' => 'index', 'id' => '\d+')
        );
        $router->addRoute('default', $route);
    }

    protected function _initView() {
        // Initialize view
        $view = new Zend_View();
        $view->doctype('XHTML1_STRICT');
        $view->headTitle('My First Zend Framework Application');
        $view->baseUrl = '/';
        // Add it to the ViewRenderer
        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
                        'ViewRenderer'
        );
        $viewRenderer->setView($view);

        // Return it, so that it can be stored by the bootstrap
        return $view;
    }

    protected function _initAutoload() {
        $acl = new Middleman_Acl(Zend_Auth::getInstance());
        $auth = Zend_Auth::getInstance();
        $fc = Zend_Controller_Front::getInstance();
        //assuming $fc is the front controller
        $fc->registerPlugin(new Middleman_Plugin_Acl($acl,$auth));
    }

}

